package com.example.demo.entity.VO;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/*
 * @Author:大力王
 * @Date:2024/5/29-29-21:14
 * 开始了
 */
@Data
@ApiModel(value = "UserRegisterVO对象", description = "用于网页注册")
public class UserRegisterVO {
    @ApiModelProperty("用户id")
    private Long id;

    @ApiModelProperty("用户名")
    @NotBlank(message = "用户名不能为空")
    private String userName;

    @ApiModelProperty("密码, 加密存储")
    @NotBlank(message = "密码不能为空")
    @Size(min = 4, max = 8, message = "密码长度必须在4到8之间")
    private String userPassword;

    @ApiModelProperty("用户头像")
    @Pattern(regexp = "^(http|https)://.*\\.(jpg|jpeg|png)$", message = "请提供有效的图片URL")
    private String userHeaderimg;

    @ApiModelProperty("电子邮件")
    @NotBlank(message = "电子邮件不能为空")
    @Email(message = "请输入有效的电子邮件地址")
    private String email;

    @ApiModelProperty("联系电话")
    @NotBlank(message = "联系电话不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phoneNumber;

    @ApiModelProperty("验证码")
    @NotBlank(message = "验证码不能为空")
    private String code;
}
